package com.xmqian.app.project.ui.main.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.Nullable;

import com.coszero.common.widget.banner.AutoBannerView;
import com.coszero.common.widget.banner.BannerUtils;
import com.coszero.common.config.IntentKey;
import com.xmqian.app.project.common.base.BaseMyFragment;
import com.xmqian.app.project.common.testdata.TestData;
import com.xmqian.kotlinApp.databinding.FragmentMainPage1Binding;


public class MainPage1Fragment extends BaseMyFragment {
    AutoBannerView mBranner;
    private FragmentMainPage1Binding binding;

    public static MainPage1Fragment newInstance(String title) {
        Bundle args = new Bundle();
        args.putString(IntentKey.EXTRA_TITLE, title);
        MainPage1Fragment fragment = new MainPage1Fragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    protected void initView() {
        mBranner = binding.includeBanner.vpBanner;
        setTitle(getArguments().getString(IntentKey.EXTRA_TITLE));
        BannerUtils.startBanner(mBranner, TestData.getBanners());
    }

    @Override
    protected void initData() {

    }

    @Override
    public void lazyLoadData() {

    }

    @Override
    public View getLayoutView(LayoutInflater inflater, @Nullable ViewGroup container, boolean attachToParent) {
        binding = FragmentMainPage1Binding.inflate(inflater, container, attachToParent);
        return binding.getRoot();
    }
}
